// 引入Express对象
var express = require('express');
var router = express.Router();

const verifyMiddleware = appRequire('routes/middleware/verify');

const artType = appRequire('controllers/admin/artType');
const artClass = appRequire('controllers/admin/artClass');
const goodClass = appRequire('controllers/admin/goodClass');
const good = appRequire('controllers/admin/good');
const artTypeClass = appRequire('controllers/admin/artTypeClass');
const artPPT = appRequire('controllers/admin/artPPT');
const artPainting = appRequire('controllers/admin/artPainting');
const banner = appRequire('controllers/admin/banner');
const todayBranner = appRequire('controllers/admin/todayBranner');
const user = appRequire('controllers/admin/user');
const order = appRequire('controllers/user/order');
const course = appRequire('controllers/admin/course');//赛事接口
const contentImage = appRequire('controllers/admin/contentImage');//朋友圈文案接口
const images = appRequire('controllers/admin/images');//朋友圈文案接口
const test = appRequire('controllers/admin/test');//朋友圈文案接口
const baiduFile = appRequire('controllers/admin/baiduFile');//同步百度文件接口
const baiduCourseSync = appRequire('controllers/admin/baiduCourseSync');//同步百度网盘课程接口
const jbMM = appRequire('controllers/admin/jbMM');//同步教培海报
const poster = appRequire('controllers/admin/poster');//同步教培海报
const dashboard = appRequire('controllers/admin/dashboard');//数据看板接口
const systemConfig = appRequire('controllers/admin/systemConfig');//系统配置接口


router.post('/images/del', images.del); //获取专题
router.post('/test', test.readFile); //获取专题

router.post('/poster/asyncPosterType', poster.asyncPosterType); //同步教培海报分类接口
router.post('/poster/asyncPosterType2', poster.asyncPosterType2); //
router.post('/poster/asyncPosterData3', poster.asyncPosterData3); //同步
router.post('/poster/asyncPosterFont', poster.asyncPosterFont); //同步
router.post('/poster/findPoster', poster.findPoster); //同步

router.post('/jbMM/getTemplates', jbMM.getTemplates); //同步教培海报接口

router.post('/baiduFile/getBaiduFile', baiduFile.getBaiduFile); //同步百度文件
router.post('/baiduFile/asayncBaiduFile', baiduFile.asayncBaiduFile); //同步百度文件

// 百度网盘课程同步接口
router.post('/baiduCourseSync/getBaiduList', baiduCourseSync.getBaiduCourseList); //获取百度网盘课程列表
router.post('/baiduCourseSync/getSyncedList', baiduCourseSync.getSyncedCourseList); //查询已同步课程
router.post('/baiduCourseSync/sync', baiduCourseSync.syncCourses); //批量同步课程
router.post('/baiduCourseSync/update', baiduCourseSync.updateCourse); //更新课程信息
router.post('/baiduCourseSync/delete', baiduCourseSync.deleteCourse); //删除课程

// 定义登录路由，POST请求
router.post('/artType/list', artType.list); //获取专题
router.post('/artType/save', artType.save); //保存专题
router.post('/artType/remove', artType.destroy); //删除专题
router.post('/artType/changeOrder', artType.changeOrder); //排序专题

router.post('/artClass/list', artClass.list); //获取分类
router.post('/artClass/save', artClass.save); //保存分类
router.post('/artClass/remove', artClass.destroy); //删除分类
router.post('/artClass/changeOrder', artClass.changeOrder); //分类排序

router.post('/goodClass/list', goodClass.list); //获取分类
router.post('/goodClass/save', goodClass.save); //保存分类
router.post('/goodClass/remove', goodClass.destroy); //删除分类
router.post('/goodClass/changeOrder', goodClass.changeOrder); //分类排序

router.post('/good/list', good.list); //获取商品
router.post('/good/save', good.save); //保存商品
router.post('/good/remove', good.destroy); //删除商品

router.post('/artTypeClass/list', artTypeClass.list); //获取专题分类
router.post('/artTypeClass/save', artTypeClass.save); //保存专题分类
router.post('/artTypeClass/remove', artTypeClass.destroy); //删除专题分类
router.post('/artTypeClass/changeOrder', artTypeClass.changeOrder); //专题分类排序

router.post('/artPPT/list', artPPT.list); //课件列表
router.post('/artPPT/save', artPPT.save); //保存课件
router.post('/artPPT/remove', artPPT.destroy); //删除课件
router.post('/artPPT/changeStatusOff', artPPT.changeStatusOff); //下架课件
router.post('/artPPT/detail', artPPT.detail); //课件详情

router.post('/artPainting/list', artPainting.list); //名画列表
router.post('/artPainting/save', artPainting.save); //保存名画
router.post('/artPainting/remove', artPainting.destroy); //删除名画

router.post('/banner/list', banner.list); //banner列表
router.post('/banner/save', banner.save); //保存banner
router.post('/banner/remove', banner.destroy); //删除banner
router.post('/banner/changeOrder', banner.changeOrder); //交换banner顺序

router.post('/order/adminMoneyList', order.adminMoneyList); //用户收益列表

router.post('/todayBranner/list', todayBranner.list); //日签图列表
router.post('/todayBranner/save', todayBranner.save); //保存日签图
router.post('/todayBranner/remove', todayBranner.destroy); //删除日签图

router.post('/user/list', user.list); //创作者列表
router.post('/user/confirm', user.confirm); //通过创作者

router.post('/course/list', course.list);
router.post('/course/save', course.save);
router.post('/course/destroy', course.destroy);
router.post('/course/addClickNum', course.addClickNum); // 增加教程的点击数

router.post('/contentImage/list', contentImage.list);
router.post('/contentImage/save', contentImage.save);
router.post('/contentImage/destroy', contentImage.destroy);

// 数据看板路由
router.post('/dashboard/statistics', dashboard.getStatistics); //获取基础统计数据
router.post('/dashboard/userRegisterTrend', dashboard.getUserRegisterTrend); //用户注册趋势
router.post('/dashboard/userLoginTrend', dashboard.getUserLoginTrend); //用户登录趋势
router.post('/dashboard/downloadTrend', dashboard.getDownloadTrend); //课件下载趋势
router.post('/dashboard/revenueTrend', dashboard.getRevenueTrend); //收益趋势
router.post('/dashboard/topPPTs', dashboard.getTopPPTs); //热门课件TOP5

// 系统配置路由
router.post('/systemConfig/getTokenList', systemConfig.getTokenList); //获取token配置列表
router.post('/systemConfig/updateToken', systemConfig.updateToken); //更新token配置

// 导出路由，供app.js文件调用
module.exports = router;
